﻿using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action.Zerg
{
	public class ActionProduceExtractor : ActionProduceFromDrone
	{

		public static ActionProduceExtractor Instance = new ActionProduceExtractor();

		private ActionProduceExtractor() : base(30, 75, 0) { }

		public override ZergState.ZergBuilding GetBuilding(ZergState state) { return state.Extractor; }
		public override string EventName { get { return "ActionSpawnExtractor"; } }
		public override bool HaveTechnology(IBuildOrder bo) { return true; }
		public override bool HaveResources(IBuildOrder bo)
		{
			ZergState state = bo.State as ZergState;
			return base.HaveResources(bo) && state.Extractor.Total + 1 <= bo.State.Bases.Total * 2;
		}
		public override bool IsInvalid(IBuildOrder bo)
		{
			ZergState state = bo.State as ZergState;
			return state.Extractor.Total + 1 > bo.State.Bases.Total * 2;
		}
	}
}
